FROM daocloud.io/library/node:latest
RUN npm config set registry https://registry.npm.taobao.org
RUN npm install pm2 cross-env webpack -g
RUN mkdir /www
WORKDIR /www
COPY ./package.json /www/
RUN npm install
COPY ./ /www/
RUN cross-env NODE_ENV=production webpack --config ./webpack/webpack.config
CMD ["cross-env","NODE_ENV=production","pm2","start","server.js","--no-daemon"]

EXPOSE 8000